<?php
// $ads = get_ads([171]);
$ads = $GLOBALS['db']->getAll('SELECT goods_id FROM'.$GLOBALS['ecs']->table('goods').' WHERE is_real=0 AND is_delete=0 ORDER BY sort_order LIMIT 4');
$data = [];
foreach ($ads as $goods)
{
    $goods_info = get_goods_info($goods['goods_id']);
    $properties = get_goods_properties($goods['goods_id']);
    $properties = current($properties['pro']);
    foreach ($properties as $v)
    {
        if ($v['name'] === '景点地址')
        {
            $attr['place'] = $v['value'];
        }
        if ($v['name'] === '简述')
        {
            $attr['resume'] = $v['value'];
        }
    }

    $data[] = [
        'goods_id'      => $goods_info['goods_id'],
        'goods_name'    => $goods_info['goods_name'],
        'click_count'   => $goods_info['click_count'],
        'img'           => $goods_info['goods_img'],
        'place'         => $attr['place'],
        'resume'        => $attr['resume']
    ];
}
return $data;